<!-- 黑名单 -->
<template>
	<view class="page">
		<view class="none" v-if="list.length == 0">
			<image src="https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/vip/%E7%A9%BA%E7%8A%B6%E6%80%81.png"></image>
			<view class="txt">这里空空如也</view>	
		</view>
		<view class="item flex align-center" v-for="(item,index) in list" :key="index">
			<view class="img flex-shrink">
				<image :src="item.avatar" mode=""></image>
			</view>
			<view class="content flex flex-wrap">
				<view class="top flex justify-between align-center flex-shrink">
					<view class="user flex align-center">
						<view class="name">
							{{item.nickname}}
						</view>
						<view class="vip flex justify-center align-center">
							<image :src="item.gradeImage" mode=""></image>
						</view>
					</view>
					<view class="cancel flex justify-center align-center" @click="cancel(item.userId)">
						取消拉黑
					</view>
				</view>
				<view class="bottom">
					{{item.userMotto}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
		data() {
			return {
				list:[],
				blackQurey:{
					id:''
				}
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			//取消拉黑
			cancel(id){
				this.blackQurey.id = id
				this.$post('/user/pullBlack',this.blackQurey).then(()=>{
					this.getData()
				})
				
			},
			//请求列表
			async getData(){
				let {data: list} = await this.$get('/user/pullBlackList')
				console.log(list)
				this.list = list
			}
		}
	}
</script>

<style lang="scss">
.page{
	min-height: 100vh;
	.none{
		position: absolute;
		left:50%;
		top:50%;
		transform: translate(-57%,-50%);
		image{
			width: 250rpx;
			height: 250rpx;
		}
		.txt{
			padding-top: 40rpx;
			color: #999999;
			font-size: 24rpx;
			display: flex;
			justify-content: center;
		}
	}
	padding: 0 30rpx;
	.item{
		height: 144rpx;
		border-bottom: 1rpx solid #f5f5f5;
		.img{
			width: 82rpx;
			height: 82rpx;
			border-radius: 50%;
			overflow: hidden;
			margin-right: 20rpx;
		}
		.content{
			.top{
				width: 588rpx;
				margin-bottom: 10rpx;
				.user{
					.name{
						font-weight: bold;
						color: #333333;
						font-size: 32rpx;
						margin-right: 20rpx;
					}
					.vip{
						width: 38rpx;
						height: 41rpx;
					}
				}
				.cancel{
					width: 144rpx;
					height: 42rpx;
					border: 1rpx solid #6FACFF;
					border-radius: 21rpx;
					font-weight: 400;
					color: #0265EB;
					font-size: 28rpx;
					line-height: 1;
				}
			}
			.bottom{
				font-weight: 400;
				color: #999999;
				font-size: 28rpx;
			}
		}
	}
}
</style>
